﻿using System;
using ThePresenter.Polls;
using ThePresenter.Net.PresenterCom.Uids;
using ThePresenter.Polls.Data;

namespace ThePresenter.Net.PresenterCom.Actions
{
	[Serializable]
	class AnswerPollAction : PresentationAction
	{
		private Uid PollId;

		private AnswerData Answer;

		public Uid AnswerSource;

		public AnswerPollAction(Poll p)
		{
			this.PollId = p.GUID;
			this.Answer = p.AnswerData;
		}

		public override void Execute(Presentation Target)
		{
			if (this.AnswerSource != null)
			{
				Target.ProcessPollAnswer(this.PollId, this.Answer, this.AnswerSource);
			}
		}
	}
}
